-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API changes to allow for public user. #1890
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few
tests/integration/lib/Rest/WarehouseExportControllerProviderTest.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing 'r' and snake_case for want_public_user have been fixed. And yes, that check is failing because of pulled code from get_dw_descripter.php
.
Description
Allows users without an authentication token to access the raw data API. Migrating the dw_descripter to the Rest stack through the route
/rest/v1/warehouse/search/dw_descripter
. Added new test cases for the new dw_descripter endpoint and modifying the test for the raw data endpoint to now pass for requests with empty token in accordance to the modifications.Two new exception classes were added for token authentication:
classes/Rest/Exceptions/BadTokenException.php
classes/Rest/Exceptions/EmptyTokenException.php
Motivation and Context
Since the raw data endpoint is used for the data catalog, this would allow for public/non logged in users to view the entries available to them without a token. Migrating the dw_descripter endpoint allows for this same behavior and places it in the same place as the rest of the API functionality. Adding the new exception classes separates
UnauthorizedHttpException
for more nuanced behavior depending on empty or invalid token.Tests performed
Automated tests. Modified tests to test for the changed functionality and added new test for the migrated endpoint.
Checklist: